Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce github action for CI #572

Merged
merged 3 commits into from
Dec 8, 2020
Merged

Introduce github action for CI #572

merged 3 commits into from
Dec 8, 2020

Conversation

mweinelt
Copy link
Contributor

@mweinelt mweinelt commented Nov 15, 2020

It seemed to me like Travis-CI checks are not working anymore. I'm aware of the new pricing policy they introduced recently and suspected it might be due to that.

The CI last ran somewhere mid-october.

Since this project is hosted on GitHub, I believe their actions feature might be a good fit for the time being. So I started to port the travis tests to the best of my understanding. I hope that is alright.

You can look at the current state over here: https://github.com/mweinelt/TTS/actions/runs/363907718


There is currently the following issue, that was introduced in 39c71ee:

 ======================================================================
ERROR: Test if all layers are updated in a basic training cycle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/TTS/TTS/tests/test_wavegrad_train.py", line 36, in test_train_step
    model.compute_noise_level(1000, 1e-6, 1e-2)
TypeError: compute_noise_level() takes 2 positional arguments but 4 were given

----------------------------------------------------------------------

I'll happyily rebase once this fix has hit the dev branch, so we can check if this works.

@lexkoro
Copy link
Contributor

lexkoro commented Nov 15, 2020

The Travis-CI checks itself are still running https://travis-ci.org/github/mozilla/TTS.
It just seems they are not integrated with github anymore, maybe because of the named new pricing policy.

@erogol
Copy link
Contributor

erogol commented Nov 29, 2020

CI is still running but not a part of Github anymore for a reason I don't know. So I close this.

@erogol erogol closed this Nov 29, 2020
@Mic92
Copy link
Contributor

Mic92 commented Dec 6, 2020

CI is still running but not a part of Github anymore for a reason I don't know. So I close this.

I just saw this. The current UX of the CI is not great (https://github.com/mozilla/TTS/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc#issuecomment-739447469). What are the reasons to stick to travis?

@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

There is no particular reason. I just wanted to keep it as it was working. But now I see it makes sense to move on.

@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

@Mic92 can we merge this one upon your review? It looks simpler and just a single file change. Do you see any particular difference in comparison to your PR?

@erogol erogol reopened this Dec 7, 2020
python3 setup.py egg_info
python3 -m pip install -e .
- name: Lint check
if: github.event_name == 'pull_request'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a direction translation of

if [[ ( "$TRAVIS_PULL_REQUEST" != "false" ) && ( "$TEST_SUITE" == "lint" ) ]]; then

but I don't think limiting linting that way is smart.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest:

Suggested change
if: github.event_name == 'pull_request'

because otherwise people doing pull requests might also have to fix linting errors that were introduced in the branches itself.

Copy link
Contributor

@erogol erogol Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if there is a linting error, it shouldn't pass the test anyway. So there should be no lining error in a branch that a PR is going on.

Copy link
Contributor

@Mic92 Mic92 Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that the linter output is always the same. However new linter versions can bring new checks and errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with applying these new checks and errors. Do you see any downside in that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct pushes to master/dev that contain linting errors will put the CI in an error state, but at least they will be visible. I don't see downsides that should prevent this.

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

Rebased and rescoped to Python 3.6-3.8. Also dropped Travis-CI.

Now the two pull requests should be more comparable.

@Mic92
Copy link
Contributor

Mic92 commented Dec 7, 2020

This one also looks fine. I would still include https://github.com/Mic92/TTS/blob/ci/.github/dependabot.yml to automatically update github actions (usually fixes bit-rot) and also cherry-pick https://github.com/Mic92/TTS/blob/ci/pyproject.toml because this way one can do pip install -e and it would already install cython/numpy before loading the setup.py which requires those libraries.

@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

This one also looks fine. I would still include https://github.com/Mic92/TTS/blob/ci/.github/dependabot.yml to automatically update github actions (usually fixes bit-rot) and also cherry-pick https://github.com/Mic92/TTS/blob/ci/pyproject.toml because this way one can do pip install -e and it would already install cython/numpy before loading the setup.py which requires those libraries.

what is the exact use case of pip install -e? I don't favor including a new file (meaning another maintenance point) if we can use requirements.txt.

@Mic92
Copy link
Contributor

Mic92 commented Dec 7, 2020

This one also looks fine. I would still include https://github.com/Mic92/TTS/blob/ci/.github/dependabot.yml to automatically update github actions (usually fixes bit-rot) and also cherry-pick https://github.com/Mic92/TTS/blob/ci/pyproject.toml because this way one can do pip install -e and it would already install cython/numpy before loading the setup.py which requires those libraries.

what is the exact use case of pip install -e? I don't favor including a new file (meaning another maintenance point) if we can use requirements.txt.

The problem is that setup.py already imports numpy/cython and hence make it impossible to add a build time dependency on both. A different option would be to completely drop requirements.txt and only use pyproject.toml pypa/pip#8049 (comment) This would simplify both CI usage and what developers need to run to a single pip install -e ..

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

This one also looks fine. I would still include https://github.com/Mic92/TTS/blob/ci/.github/dependabot.yml to automatically update github actions (usually fixes bit-rot) and also cherry-pick https://github.com/Mic92/TTS/blob/ci/pyproject.toml because this way one can do pip install -e and it would already install cython/numpy before loading the setup.py which requires those libraries.

I'm not sure how the pyproject.toml and the requirements.txt would interact. Maybe you can expand on that?

FWIW: I do think that pyproject.toml is the superior format. Especially when relying on poetry, which I do strongly recommend using.

what is the exact use case of pip install -e? I don't favor including a new file (meaning another maintenance point) if we can use requirements.txt.

With pip install -e . the local package will be installed in an editable fashion, as in: not as an egg. Not sure that's actually required for anything.

@Mic92 Mic92 mentioned this pull request Dec 7, 2020
@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

for pip install -e one can use python setup.py develop I guess until we have an official release. Let me know if there is a particular difference.

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

The reason why @Mic92 introduced the pyproject.toml is that it provides build-time dependency support. This is required because numpy needs to be preinstalled as it is directly used in setup.py.

TTS/setup.py

Line 8 in 88bb20e

import numpy

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

I don't think this can be done by using a single requirements.txt, if that is what you are asking.

@Mic92
Copy link
Contributor

Mic92 commented Dec 7, 2020

for pip install -e one can use python setup.py develop I guess until we have an official release. Let me know if there is a particular difference.

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

Calling setup.py directly has the same issue as pip install -e .. They both need cython/numpy beeing manually installed or the build will fail. This is not optimal for people that just want to run:

$ pip install git+https://github.com/mozilla/TTS

@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

I don't think this can be done by using a single requirements.txt, if that is what you are asking.

I meant in general is there any other way to define setup.py deps than pyproject.toml?

If you think .toml is the best way then I think we can include it as it is useful for CI and first-time installs as you've indicated.

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

I don't think this can be done by using a single requirements.txt, if that is what you are asking.

I meant in general is there any other way to define setup.py deps than pyproject.toml?

According to pypa/pip#2381 (comment) pyproject.toml is the way to go.

@Mic92
Copy link
Contributor

Mic92 commented Dec 7, 2020

But I see the point of using pyproject.toml. Do you know any other way to indicate setup dependencies?

I don't think this can be done by using a single requirements.txt, if that is what you are asking.

I meant in general is there any other way to define setup.py deps than pyproject.toml?

Not as far as I know: pypa/pip#2381
There is setup_requires but it does not work in the way one expect and cannot be used to install build time dependencies. This also a big pain point we have in NixOS/nixpkgs when packaging python.
The escape hatch would be poetry, which is closer to modern package manager like cargo or yarn and capture the whole dependency tree.

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

@Mic92
Copy link
Contributor

Mic92 commented Dec 7, 2020

@mweinelt I also noticed this here: #591 (comment)

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

I tried pinning numpy<1.20 and it installs that just fine. Then pyworld comes along and then there isnumpy==1.20-rc1 for some odd reason.

https://github.com/mweinelt/TTS/runs/1510479798?check_suite_focus=true

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

I think considering Debian Stable already has Python 3.7 dropping support for Python 3.6 wouldn't be a big loss.

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
python3 setup.py egg_info
python3 -m pip install -e .
- name: Lint check
if: github.event_name == 'pull_request'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with applying these new checks and errors. Do you see any downside in that ?

tests/test_server_package.sh Show resolved Hide resolved
@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

I think considering Debian Stable already has Python 3.7 dropping support for Python 3.6 wouldn't be a big loss.

I'd prefer to keep supporting 3.6

@erogol
Copy link
Contributor

erogol commented Dec 7, 2020

I tried pinning numpy<1.20 and it installs that just fine. Then pyworld comes along and then there isnumpy==1.20-rc1 for some odd reason.

https://github.com/mweinelt/TTS/runs/1510479798?check_suite_focus=true

I don't see why it forces to install numpy 1.20

Reading setup.py will import numpy already,
hence pip has no way to figure out what dependencies are needed.
@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

I tried pinning numpy<1.20 and it installs that just fine. Then pyworld comes along and then there isnumpy==1.20-rc1 for some odd reason.
https://github.com/mweinelt/TTS/runs/1510479798?check_suite_focus=true

I don't see why it forces to install numpy 1.20

Opened up a bug report over at pypa/pip#9239 including a minimal reproducer.

Also opened up an issue over at pyworld, so maybe they can release a version with a proper environment pin, thereby resolving the situation. JeremyCCHsu/Python-Wrapper-for-World-Vocoder#59

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 7, 2020

Explanation of whats happening: pypa/pip#9239 (comment).

I guess this broke, when numpy released the first version incompatible with Python 3.6. So we currently have no way until pyworld pushes a fix. I opened JeremyCCHsu/Python-Wrapper-for-World-Vocoder#59 to get that process started.

Meanwhile I fixed up the lint step and a few issues have accumulated. https://github.com/mweinelt/TTS/runs/1511860335?check_suite_focus=true

@Mic92
Copy link
Contributor

Mic92 commented Dec 8, 2020

Travis is no longer free btw: https://news.ycombinator.com/item?id=25338983

@erogol
Copy link
Contributor

erogol commented Dec 8, 2020

I think it is ready to merge than give that travis is not an option any more.

Anything else before merge ?

@erogol erogol merged commit 2f689cb into mozilla:dev Dec 8, 2020
@erogol
Copy link
Contributor

erogol commented Dec 8, 2020

I just realized that Github Actions are not allowed by Mozilla. Now I try to find a workaround.

@erogol
Copy link
Contributor

erogol commented Dec 8, 2020

or do you have any other suggestions as a CI alternative for open-source?

@erogol
Copy link
Contributor

erogol commented Dec 8, 2020

I guess I go for Circle CI

@mweinelt
Copy link
Contributor Author

mweinelt commented Dec 8, 2020

I just realized that Github Actions are not allowed by Mozilla. Now I try to find a workaround.

Ah, meh.

or do you have any other suggestions as a CI alternative for open-source?

Not really.

I hope once the issues with pyworld are fixed we can integrate the pyproject.toml changes.

@erogol
Copy link
Contributor

erogol commented Dec 8, 2020

Sorry for being unaware of it

feel free to introduce pyproject.toml once it is the right time.

@mweinelt mweinelt deleted the gh-actions branch December 8, 2020 23:13
Mic92 pushed a commit to Mic92/TTS that referenced this pull request Oct 27, 2021
Forcing do_trim_silence to False in the extract TTS script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants